/**
 * AMF3 type markers and constants for AVM+ Serialization
 *
 * @author dongzhixiang
 * @date 2008-10-10
 */

#if !defined(AMF3_TYPE_H)
#define AMF3_TYPE_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "../basic/object.h"

#ifdef HT_USE_DLL

	#ifdef _MSC_VER
		#include <windows.h>
		//  stl warning
		#pragma warning(disable:4786)
		#pragma warning(disable:4291)
		#pragma warning(disable: 4275)
		#pragma warning(disable: 4251)

		#ifdef AMF_EXPORT_DLL
			#define AMF_CLASS_EXPORT	__declspec(dllexport)
			#define AMF_FUNC_EXPORT		__declspec(dllexport)
		#else
			#define AMF_CLASS_EXPORT	__declspec(dllimport)
			#define AMF_FUNC_EXPORT		__declspec(dllimport)
		#endif // AMF_EXPORT_DLL
	#else
		// For other platform
		#define HT_CLASS_EXPORT	
		#define HT_FUNC_EXPORT	
	#endif //_MSC_VER*/

#else	// HT_USE_DLL
	#define AMF_CLASS_EXPORT
	#define AMF_FUNC_EXPORT
#endif // HT_USE_DLL


namespace Amf{
	/**  AMF3 types */
	enum AMF3Type 
	{ 
		AMF3_UNDEFINED = 0,
		AMF3_NULL = 1,
		AMF3_FALSE = 2,
		AMF3_TRUE = 3,
		AMF3_INTEGER = 4,
		AMF3_NUMBER = 5,
		AMF3_STRING = 6,
		AMF3_XML = 7,
		AMF3_DATE = 8,
		AMF3_ARRAY = 9,
		AMF3_OBJECT = 10,
		AMF3_XMLSTRING = 11,
		AMF3_BYTEARRAY = 12,

		AMF3_ARRAY_EX_FLOAT64 = 98,
		AMF3_ARRAY_EX_INT32 = 99,
	};

	//String EMPTY_STRING = "";
	const wchar_t EMPTY_STRING[] = L"";

	/**
	 * Internal use only
	 * @exclude
	 */
	//int UINT29_MASK = 0x1FFFFFFF; // 2^29 - 1
	const int32 UINT29_MASK = 0x1FFFFFFF;

	/**
	 * The maximum value for an <code>int</code> that will avoid promotion to an
	 * ActionScript Number when sent via AMF 3 is 2<sup>28</sup> - 1, or <code>0x0FFFFFFF</code>.
	 */
	//int INT28_MAX_VALUE = 0x0FFFFFFF; // 2^28 - 1
	const int32 INT28_MAX_VALUE = 0x0FFFFFFF;

	/**
	 * The minimum value for an <code>int</code> that will avoid promotion to an
	 * ActionScript Number when sent via AMF 3 is -2<sup>28</sup> or <code>0xF0000000</code>.
	 */
	//int INT28_MIN_VALUE = 0xF0000000; // -2^28 in 2^29 scheme
	const int32 INT28_MIN_VALUE = 0xF0000000;

}//namespace Amf

#endif //AMF3_TYPE_H
